home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 28
/
Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso
/
Aminet
/
util
/
misc
/
DragBox.lha
/
DragBox.txt
< prev
next >
Wrap
Text File
|
1998-10-30
|
8KB
|
250 lines
-DragBox- v1.3 (30.10.98)
Distribution
************
Copyright (C) 1998 Juha 'Asa' Pinola
DragBox is available as freeware. That is, it may be freely distributed
in unmodified form with no changes what so ever, but you may not charge
more than a nominal fee covering distribution costs. However, donations
are welcome.
If you use this software in a commercial or shareware software product,
please consider giving the author and preferably each one of the
contributors an original or registered version of your work.
If you wish to distribute this software with a hardware product, contact
the author. Distribution of DragBox with hardware products is not free.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
****************************************
Installing
----------
Just copy DragBox to c:DragBox or somewhere else.
And try run the included DragShell.info from its icon
and see what this program does.
For faster response insert a line:
"resident c:dragbox pure >nil:" to your s:startup-sequence
or s:user-startup
****************************************
The Author
----------
The author can be reached at the following addresses:
Electronic mail
jpinola@cs.joensuu.fi
World-Wide Web
http://cs.joensuu.fi/~jpinola
IRC: Asa/#amigafin/#amycoders
****************************************
Example usage:
newcli from s:shell-startup window con:`DragBox`/DragShell/CLOSE
newcli from s:shell-startup window kcon:`DragBox center font times.font`/Dragbox rules/CLOSE
newcli window con:`DragBox w 300 h 100`/DragShell/CLOSE
newcli window con:`DragBox 10 10 300 100 c`/DragShell/CLOSE
newcli window con:`DragBox col_text ffffff`/DragShell/CLOSE
Or edit sys:system/shell.info
and edit the tooltypes:
WINDOW=con:`DragBox w 600 h 300 c min_w 200 min_h 50`/Shell/CLOSE
You can change the return format:
DragBox format "left %ld top %ld " (Only x,y coords)
DragBox format "x=%ld y=%ld w=%ld h=%ld" (All coords)
Or change the environment variable:
DragBox env DRAGBOX_DEFAULTS2
To clone a window make an environment variable:
setenv DRAGBOX_CLONE "RELATIVE SIZE_FROM_ACTIVE MIDDLE"
Then add a hotkey to somewhere (ie. MCP's Execute command hotkey)
And se execution line to:
newcli from s:shell-startup window con:`dragbox env DRAGBOX_CLONE`/Clone Shell/CLOSE
To set alternative position for shell window:
DragBox format "%ld/%ld/%ld/%ld/%s///ALT %ld/%ld/%ld/%ld" ax +10 ay -40 aw 100 ah 400
Sets alternative position to X +10 Y -40 Width 100 Height 400
****************************************
Command line parameters:
"X=DEF_X/N,Y=DEF_Y/N,W=DEF_W/N,H=DEF_H/N,C=CENTER/S,
L=LEFT/S,M=MIDDLE/S,R=RIGHT/S,F=FONT/K,FS=FSIZE/N/K,
MIW=MIN_W/N/K,MIH=MIN_H/N/K,MAW=MAX_W/N/K,MAH=MAX_H/N/K,
CBACK=COL_BACK/K,CBRIGHT=COL_BRIGHT/K,CDARK=COL_DARK/K,CSHADOW=COL_SHADOW/K,CTEXT=COL_TEXT/K,
WX=WIN_X/N/K,WY=WIN_Y/N/K,NOW=NOWIN/S,
FO=FORMAT/K,ENV/K,
TO=TIME_OUT/N/K,AD=ADRAG/S,
REL=RELATIVE/S,SFA=SIZE_FROM_ACTIVE/S,
PTS=PASSTHRU_STRING/K,AX=ALT_X/K,AY=ALT_Y/K,AW=ALT_W/K,AH=ALT_H/K"
X = Default x
Y = Default y
W = Default width
H = Default height
C = Dragbox is in the middle of mouse pointer
L = Left button
M = Middle button
R = Right button
F = Name of the font
FS = Size of the font
MIN_W = Minimum width allowed
MIN_H = Minimum height allowed
MAX_W = Maximum width allowed
MAX_H = Maximum height allowed
COL_BACK = Color for background (example COL_BACK 23ff00 is 0x23 , for red 0xff for green , and 0x00 for blue)
COL_BRIGHT = Color for bright edge of window
COL_DARK = Color for dark edge of window
COL_SHADOW = Color for shadow of text
COL_TEXT = Color for text
WIN_X = left edge coord for the coords window
WIN_Y = top edge coord for the coords window
NOWIN = no coords window
FORMAT = Format of return string. %ld for number (x,y,w,h)
ENV = Set name of the environment variable. (use only names no paths! default: DRAGBOX_DEFAULT)
TIME_OUT = dragbox time out. -1 for infinite (default is 20 intuiticks aprox)
ADRAG = Box can be dragged after resize operation
RELATIVE = Dragbox is relative to starting position of mouse
SIZE_FROM_ACTIVE = Starting size is taken from currently active window (disables CENTER/S and ADRAG/S)
PASSTHRU_STRING = Puts this string to %s position in format string
ALT_X = Alternative x (absolute values. use - or + sign to relative values)
ALT_Y = Alternative y
ALT_W = Alternative w
ALT_H = Alternative h
****************************************
Env variable:
DRAGBOX_DEFAULTS = [as command line]
Example: ( "setenv DRAGBOX_DEFAULTS DEF_W 600 MIDDLE FONT topaz.font FSIZE 8" )
( "setenv DRAGBOX_DEFAULTS COL_SHADOW 000000 COL_TEXT ffffff" )
(copy env:DRAGBOX_DEFAULTS to envarc:)
****************************************
Notes and bugs:
Use middle or right mouse button with this (right is default),
because WB uses left button with it's dragbox..
Trashes the screen if something moves under the dragbox.
Dragbox quits when:
1. Selected button is pressed and released
2. When coord window is deactived (if you have sunpopup or something, sorry)
3. Command line and/or env variable is corrupt. (returns factory defaults)
4. Keys Return/Esc/Spacebar is pressed
5. The format string format is 4-integers 1-string 4-integers ONLY!
ie. "%ld %ld %ld %ld %s %ld %ld %ld %ld"
NO! "%ld %ld %s %ld %s %ld %ld" Propably crashes
6. Atleast 4096 stack
(factory defaults:
"X 0 Y 0 W 200 H 200
RIGHT FONT webfixed.font FSIZE 12
MIN_W 30 MIN_H 30 MAX_W 10000 MAX_H 10000
COL_BACK 777777 COL_BRIGHT ffffff COL_DARK 000000 COL_SHADOW 333333 COL_TEXT cccccc"
FORMAT "%ld/%ld/%ld/%ld" ENV DRAGBOX_DEFAULT
TIME_OUT 20"
)
****************************************
History:
--------------
v 1.3
+ PTS=PASSTHRU_STRING/K added
+ AX=ALT_X/K,AY=ALT_Y/K,AW=ALT_W/K,AH=ALT_H/K added
- Need more stack now ?! If you run this from Shell.info then you
should have atleast 4096 stack set. Lockup if not enough stack.
--------------
v 1.2
+ SFA=SIZE_FROM_ACTIVE/S added
+ REL=RELATIVE/S added
--------------
v 1.1
+ Check for too small width/height. (less than 1 x 1)
--------------
v 1.00
+ Less flickering lines
+ ADRAG/S added
+ TIME_OUT/N/K added
+ WIN_X/N/K,WIN_Y/N/K,NOWIN/S added
+ Some fixes
--------------
v 1.00b
--------------
v 0.99b
+ ENV/K added
--------------
v 0.99
+ FORMAT/K added
--------------
v 0.98
+ COL_BACK/K,COL_BRIGHT/K,COL_DARK/K,COL_SHADOW/K,COL_TEXT/K added
+ MIN_W/N/K,MIN_H/N/K,MAX_W/N/K,MAX_H/N/K added
--------------
v 0.94
+ CENTER/S fixed
+ Only one global variable now (DRAGBOX_DEFAULTS)
Old variables are now ignored, kill them.